#FIND_PACKAGE(Qt4 REQUIRED)
find_package(Qt5 REQUIRED Core Widgets Gui OpenGL)
    if (Qt5_POSITION_INDEPENDENT_CODE)
        SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
    endif()
find_package(Qt5Widgets)
SET(QT_USE_QTOPENGL ON)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
#INCLUDE(${QT_USE_FILE})
find_package(OpenGL)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${Qt5OpenGL_INCLUDE_DIRS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(-fPIC)
SET(SOURCES          clip.cc calibration.cc gl.cc tracker.cc zoom.cc main.cc)
QT5_WRAP_CPP(SOURCES clip.h  calibration.h        tracker.h  zoom.h  main.h)
QT5_ADD_RESOURCES(SOURCES tracker.qrc)
ADD_EXECUTABLE(qt-tracker ${SOURCES})
TARGET_LINK_LIBRARIES(qt-tracker
                      PUBLIC
		      Qt5::Core
                      Qt5::Widgets
                      Qt5::Gui
                      Qt5::OpenGL
                      ${QT_LIBRARIES}
                      ${OPENGL_LIBRARIES}
                      ${FFMPEG_LIBRARIES}
                      simple_pipeline
                      tracking
                      multiview
                      image
                      ${CERES_LIBRARIES}
                      png
                      jpeg
		      X11
                      z
                      lzma
                      vdpau
                      swresample)
LIBMV_INSTALL_EXE(qt-tracker)
